//
//  DictionaryExtension.swift
//  GomroClient
//
//  Created by mac on 2019/12/24.
//  Copyright © 2019 cn.gomro.app. All rights reserved.
//

import Foundation

extension Dictionary {
    /** 两个字典合并(" + " 运算) */
    mutating func merge(dict: [Key: Value]){
        for (k, v) in dict {
            updateValue(v, forKey: k)
        }
    }
    
    /** 判断两个 Dictionary 是否相等 */
    func isEqualTo(Dictionary dic:Dictionary) -> Bool {
        return NSDictionary.init(dictionary: self).isEqual(to: dic)
    }
}
